<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>コントロールパネル</title>

    <link href="./assets/styles/default.css" rel="stylesheet" />
	<script src="./assets/scripts/libs/jquery-1.7.1.min.js" type="text/javascript"></script>
	<script src="./assets/scripts/import.js" type="text/javascript"></script>

</head>
<body>

{{$zhead}}

<div id="container">
	{{$zmenu}}
    <article>
    	<h2><span>&nbsp;</span>会員管理<p><a href="javascript:;">Open Plugins</a></p></h2>
        <nav>
        		<ul>
				<li class="active"><a href="{{'Home/user/index'|U}}"><span>会員検索</span></a></li>
				<li><a href="{{'Home/user/insert'|U}}"><span>会員登録</span></a></li>
			</ul>
        </nav>

        <section id="content">

        	<h3>会員配送先情報</h3>

			<ul class="btns b20" style="position:relative;top:10px;">
				<li class="btn left c"><a href="{{'Home/user/refer'|U}}?id={{$id}}">情報参照</a></li>
				<li class="btn center c"><a href="{{'Home/user/update'|U}}?id={{$id}}">情報更新</a></li>
				<li class="btn center c"><a href="{{'Home/delivery/refer'|U}}?id={{$id}}" >配送先情報</a></li>
				<li class="btn center c"><a href="{{'Home/OrderManage/userGoods'|U}}?id={{$id}}" class="active">注文情報</a></li>
				<li class="btn center c"><a href="{{'Home/email/emailRecord'|U}}?id={{$id}}" >メール履歴</a></li>
			</ul>

			<h4><span>&nbsp;</span>メール履歴</h4>

			<form name="form1" id="form1" method="get" action="{{'Home/User/emailRecord'|U}}">
			<table id="search_result" class="sortable">
			<input type="hidden" name="page"  />
			<input type="hidden" name="csv" />
				<thead>
					<tr>
						<th class="align-center">処理</th>
						<th class="align-center">注文日時<br />注文番号</th>
						<th>状態<br />経路</th>
						<th>購入者氏名</th>
						<th>配送先住所</th>
						<th>支払方法<br />発送方法</th>
						<th>合計金額<br />手数料</th>
						<th>更新</th>
						<th>配送完了</th>
					</tr>

				</thead>
				<tbody>
					{{foreach name=orderloop from=$orderlist item=i}}
					<tr>
						<td><label><input type="checkbox" name="ctrl" value="" id="orderchecked" orderid="{{$i.order_id}}"/></label></td>
						<td class="align-left">{{$i.order_time|date_format:"%Y-%m-%d %H:%M:%S"}}<br />{{$i.order_number}}</td>
						<td ><span id="order_status_{{$i.order_id}}">{{if $i.order_status eq 1}}未確定{{elseif $i.order_status eq 2}}確定{{elseif $i.order_status eq 3}}発想済{{elseif $i.order_status eq 4}}キャンセル{{/if}}</span><br />{{if $i.order_way eq 1}}PC{{elseif $i.order_way eq 2}}スマホ{{/if}}</td>
						<td>{{$i.user_name1|cat:$i.user_name2}}</td>
						<td>{{$i.send_local_name|cat:" "|cat:$i.send_treet_name|cat:" "|cat:$i.send_address}}</td>
						<td>{{$i.pay_content}}<br />{{$i.send_content}}</td>
						<td class="align-right">{{$i.sumprice|string_format:"%.0f"}}円<br />{{$i.buying_price|string_format:"%.0f"}}円</td>
						<td class="update"><a href="{{'Home/OrderRefer/index'|U}}?oid={{$i.order_id}}">更新</a></td>
						<td class="preview"><a href="#" onclick="updatesended([{{$i.order_id}}],3);return false;">発送完了</a></td>
					</tr>
					{{/foreach}}
				</tbody>
			</table>
			
			<p class="pageNav">
				{{section name=loop loop=$pagecount}}
				<a href="#" onclick="aclick({{$smarty.section.loop.index+1}});return false;" {{if $smarty.section.loop.index+1 eq $nowpage}}class="current"{{/if}}>{{$smarty.section.loop.index+1}}</a>
				{{/section}}
			</p>
			<script type="text/javascript">
			function aclick(ipage)
			{
				$('#nowpage').val(ipage);
				$('#form1').attr('action','{{'Home/OrderManage/changepage'|U}}');
				document.getElementById("form1").submit();
			}
			</script>
</form>
        </section>
    </article>

</div>
<script type="text/javascript">
		$(function() {
			$('.message').fadeIn("slow");
			$('.text_date').datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'yy/mm/dd'
			});
			$('#btn-export').click(function(){	
				if(confirm('ダウンロードしますか？')){
					document.form1.csv.value="download";
					document.form1.submit();
					
				}
			});
			$('#btn-reset').click(function(){	
				location.href = document.form1.action;
			});
			
			$('#btn_search').click(function(){	
				document.form1.csv.value="";
				document.form1.submit();
			});
		});
	
		function toPage(thepage) {
			document.form1.page.value =  thepage;
			document.form1.csv.value="";
			document.form1.submit();
		}

      
		</script>
<footer id="dashboard_footer">Copyright (C) SHIFT. / All rights reserved.</footer>
</body>
</html>